<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>故障报告管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
    <style type="text/css">
        #maintenUnitCode {
            -webkit-border-radius: 4px;
            border: 1px solid #ccc;
            padding: 4px 6px;
        }

    </style>
</head>
<body>
<%--
<ul class="nav nav-tabs">
    <shiro:hasPermission name="elmt:failureReport:edit"><li><a href="${ctx}/elmt/failureReport/addForm">故障报告添加</a></li></shiro:hasPermission>
</ul>
--%>
<form:form id="searchForm" modelAttribute="failureReport" action="${pageContext.request.contextPath}/f/sydwfront/failureList" method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <input id="deviceCode" name="deviceCode" type="hidden" value="${failureReport.deviceCode}"/>

    <div class="container-fluid">
        <div class="row">
            <div class="control-label col-xs-12">
                <label>故障报告单编号：</label>
                <form:input path="failureNo" htmlEscape="false" maxlength="20" class="form-control input-sm input-medium"/>

                <label>维保单位代码：</label>
                <input id="maintenUnitCode" name="maintenUnitCode" htmlEscape="false" maxlength="100" class="form-control input-sm input-medium"/>

                <label>是否困人：</label>
                <form:select path="trappedPeople" class="form-control input-sm input-medium">
                    <form:option value="" label=""/>
                    <form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>

                <label>故障状态：</label>
                <form:select path="failureStatus" class="form-control input-sm input-medium">
                    <form:option value="" label=""/>
                    <form:options items="${fns:getDictList('FAILURE_STATUS')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>

                <label>处理状态：</label>
                <form:select path="processStatus" class="form-control input-sm input-medium">
                    <form:option value="" label=""/>
                    <form:options items="${fns:getDictList('FAILURE_PROCESS_STATUS')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>

                <label>故障报告时间：</label>
                <input name="reportTime" type="text" readonly="readonly" maxlength="20" class="form-control input-sm input-medium Wdate"
                       value="<fmt:formatDate value="${failureReport.reportTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                至
                <input name="reportTime" type="text" readonly="readonly" maxlength="20" class="form-control input-sm input-medium Wdate"
                       value="<fmt:formatDate value="${failureReport.reportTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
            </div>
        </div>
    </div>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>故障报告单编号</th>
        <th>设备注册代码</th>
        <th>设备所在地点</th>
        <th>开始时间</th>
        <th>到达时间</th>
        <th>完成时间</th>
        <th>是否困人</th>
        <th>脱困情况</th>
        <th>被困人数</th>
        <th>维保人员</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="failureReport">
        <tr>
            <td>
                <a href="${pageContext.request.contextPath}/f/sydwfront/failureForm?formId=${failureReport.formId}">${failureReport.failureNo}</a>
            </td>
            <td>
                    ${failureReport.deviceCode}
            </td>
            <td>
                    ${failureReport.deviceAddr}
            </td>
            <td>
                <fmt:formatDate value="${failureReport.reportTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <fmt:formatDate value="${failureReport.arrivalTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                <fmt:formatDate value="${failureReport.completionTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
            </td>
            <td>
                    ${fns:getDictLabel(failureReport.trappedPeople, 'yes_no', '')}
            </td>
            <td>
                    ${fns:getDictLabel(failureReport.outDifficulty, 'OUT_DIFFICULTY', '')}
            </td>
            <td>
                    ${failureReport.trappedNumber}
            </td>
            <td>
                    ${fns:getByLoginName(failureReport.maintenanceStaff).getName()}
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div style="text-align: center;">
    <div class="pagination">${page}</div>
</div>
</body>
</html>